<body>
	<div class="subnav">
		<div class="content-menu ib-a blue line-x">
			<a href='/Notice/'><em>公告列表</em></a><span>|</span><a
				href='javascript:;' class="on"><em>添加公告</em></a>
		</div>
	</div>
	<div class="pad_10">
		<form method="post" action="/Notice/add/" name="myform" id="myform">
			<table class="table_form" width="100%" cellspacing="0">
				<tbody>
					<tr>
						<th width="80"><strong>公告分类：</strong></th>
						<td><select id="cateid" name="cateid">
								<option value="">--请选择分类--</option>
								<?php
								if(!empty($Catelist)) {
								foreach ($Catelist as $val) {
								?>
								<option value="<?php echo $val['NoticeCate']['id'] ?>">
									<?php echo $val['NoticeCate']['name'] ?>
								</option>
								<?php }} ?>
						</select></td>
					</tr>
					<tr>
						<th width="80"><strong>公告标题：</strong></th>
						<td><input name="title" id="title" class="input-text"
							type="text" size="50"></td>
					</tr>
					<tr>
						<th><strong>起始日期：</strong></th>
						<td><input type="text" name="starttime" id="starttime"
							value="" size="21" class="date" readonly>&nbsp;</td>
					</tr>
					<tr>
						<th><strong>截止日期：</strong></th>
						<td><input type="text" name="endtime" id="endtime" value=""
							size="21" class="date" readonly>&nbsp;</td>
					</tr>
					<tr>
						<th><strong>公告内容：</strong></th>
						<td><textarea name="content"
								style="width: 670px; height: 270px; visibility: hidden;"
								id="content"></textarea></td>
					</tr>
					<tr>
						<th><strong>公告状态：</strong></th>
						<td><input name="state" type="radio" value="1" checked>&nbsp;通过&nbsp;&nbsp;<input
							name="state" type="radio" value="0">&nbsp;待审核</td>
					</tr>
				</tbody>
			</table>
			<div class="bk15"></div>
			<input name="dosubmit" type="submit" value="提交" class="button">
		</form>
	</div>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		//日期选择控件
		Calendar.setup({
			weekNumbers : true,
			inputField : "starttime",
			trigger : "starttime",
			dateFormat : "%Y-%m-%d",
			showTime : true,
			minuteStep : 1,
			onSelect : function() {
				this.hide();
			}
		});

		Calendar.setup({
			weekNumbers : true,
			inputField : "endtime",
			trigger : "endtime",
			dateFormat : "%Y-%m-%d",
			showTime : true,
			minuteStep : 1,
			onSelect : function() {
				this.hide();
			}
		});

		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				uploadJson : '/js/kindeditor/php/upload_json.php',
				fileManagerJson : '/js/kindeditor/php/file_manager_json.php',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	})
</script>